﻿using Little.Soldier;
using Little.Soldier.SWIFT;
using System;
using System.IO;

namespace Little.Soldier
{
    internal class U0007
    {
        internal virtual string U0004U0003(SwiftMessage msg)
        {
            TextParser obj = new TextParser();
            StringWriter stringWriter = new StringWriter();
            obj.WriteMessage(msg, (TextWriter)stringWriter);
            return ((object) stringWriter.GetStringBuilder()).ToString();
        }

        internal virtual SwiftMessage U0005U0003(string fin)
        {
            IReader obj = new IReader(fin);
            try
            {
                return obj.Message;
            }
            catch (IOException ex)
            {
                throw new Exception("Exception during parse of message.\n\r" + ex.ToString());
            }
        }
    }
}
